package com.iusis.game;

import android.app.Activity;
import android.content.*;
import android.content.pm.*;
import android.os.*;
import android.util.*;
import android.view.*;
import android.view.View.OnClickListener;
import android.widget.*;

// 로고를 보여준 후 다음액티비티로 이동시키는 액티비티
public class LogoActivity extends Activity implements OnClickListener{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
         
//        //1. 풀스크린(타이틀바와 스테이터스바를 숨김)
//        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,        		
//        		        WindowManager.LayoutParams.FLAG_FULLSCREEN ); 
//        //2. 타이틀바를 안보이게
//        requestWindowFeature(Window.FEATURE_NO_TITLE);
//        
//        //3. Manifest.xml에 액티비티 속성으로 삽입
//        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
//        
        setContentView(R.layout.logo);
        
        
        
        // 일정시간후 메뉴 액티비티로 이동하고 로고 액티비티는 종료
        long delayMillis = Long.parseLong(getResources().getString(R.string.delayMillis));
        Log.d("test", "delay(ms): "+delayMillis);
        
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
			@Override
			public void run() {
				Log.d("test", "In Handler, move to: "+MainActivity.class.toString());
				
				Intent intent = new Intent(LogoActivity.this, MainActivity.class);
				startActivity(intent);
				overridePendingTransition(R.anim.fade, R.anim.hold);
				finish();
			}
		}, delayMillis);	// 1000ms
        
        
    }

	@Override
	public void onClick(View v) {
		Log.d("test", "In onClick, move to: "+MainActivity.class.toString());
		
		Intent intent = new Intent(LogoActivity.this, MainActivity.class);
		startActivity(intent);
		overridePendingTransition(R.anim.fade, R.anim.hold);
		finish();
	}
    
}